<script lang="ts" setup>
import { ref, watch } from 'vue';

const total = ref(10);

const han = ref('震惊！')

watch([total,han],(newvalue,oldvalue) => { 
  console.log('totalCount变化了', total.value)
  console.log({ newvalue, oldvalue })
})
</script>

<template>
<p>计数器：{{ total }}</p>
<p>{{ han }}</p>
<button @click="total++">点击+1</button>
<button @click="han +='!'">点击继续震惊</button>
</template>